{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 目标\n",
    "* 跑的时候，体力值下降\n",
    "* 不跑的时候，体力值缓慢上升\n",
    "* 正在跑的时候，体力值到0就不能跑了，自动变成走\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 注意\n",
    "键盘事件和tick事件的区别"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 创建变量\n",
    "* 编辑FirstPersonCharacter\n",
    "    * 创建变量， StaminaCost， 代表体力消耗， 浮点 默认 0.1\n",
    "    * 创建变量， StaminaRecharge， 代表体力回升， 浮点 默认 0.05\n",
    "    * IsSprint， 布尔类型，默认值为False，代表是否正在跑动\n",
    "\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0004_3_1.png)\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0004_3_2.png)\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0004_3_3.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 奔跑时体力下降，停止奔跑，体力值缓慢恢复\n",
    "* 添加自定义事件SprintBegin， 快跑时，每隔0.2秒触发事件，体力值减少，并且不能小于0；停止跑动，清空事件。\n",
    "* 奔跑时设置IsSprint为True，停止奔跑，设置IsSprint为False。\n",
    "* 添加Tick事件，每隔0.2秒，体力值慢慢恢复，并且不能大于1\n",
    "\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0004_4.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 跑到一半，体力值减少到0，不能再跑\n",
    "![image.png](https://gitee.com/lhqer/cplusplus_junior_teacher/raw/master/img/UE4/BP/0004_5.png)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
